package com.snowy.framework.exception;

import com.snowy.framework.common.base.dto.BaseReturn;
import lombok.Data;

/**
 * 异常基类
 * @Author cl
 * @Date 2020.10.30
 */
@Data
public class UABPException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    private String message;
    private String code;
    private Throwable throwable;

    public UABPException(String message) {
        super(message);
    }

    public UABPException(String code,String message) {
        this.code=code;
        this.message=message;
    }

    public UABPException(BaseReturn baseReturn) {
        this.code=baseReturn.getReturnCode();
        this.message=baseReturn.getReturnMsg();
    }

    public UABPException(Throwable throwable) {
        super(throwable);
    }

    public UABPException(String message, Throwable throwable) {
        super(message, throwable);
    }

    public UABPException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
        super(message, throwable, enableSuppression, writableStackTrace);
    }


}
